#chm to html 
#Ŀ¼ dir.hhc
require 'Hpricot'

doc = Hpricot(open("dir.hhc"))
doc.at('head').inner_html = '<link rel="stylesheet" href="hhc.css" type="text/css" />'
(doc/'object').each{|object|
	object.remove_attribute 'type'
	name = ''
	local = ''
	t = object.at('param[@name=Name]')
	name = t.get_attribute('value') if t!=nil
	t = object.at('param[@name=Local]')
	local = t.get_attribute('value') if t!=nil
	
	object.inner_html = '<a href="'+ local+ '" target="show">'+ name + '</a>'
}
open('dir.html','w').print doc